<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Hook Functions</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
<link rel="prev" href="glib-Random-Numbers.html" title="Random Numbers">
<link rel="next" href="glib-Miscellaneous-Utility-Functions.html" title="Miscellaneous Utility Functions">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Random-Numbers.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Miscellaneous-Utility-Functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3112136" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id3113248" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-Hook-Functions"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3112136"></a><span class="refentrytitle">Hook Functions</span>
</h2>
<p>Hook Functions &#8212; support for manipulating lists of hook functions</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;


                    <a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a>;
void                (<a class="link" href="glib-Hook-Functions.html#GHookFinalizeFunc">*GHookFinalizeFunc</a>)                (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
                    <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>;
void                (<a class="link" href="glib-Hook-Functions.html#GHookFunc">*GHookFunc</a>)                        (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (<a class="link" href="glib-Hook-Functions.html#GHookCheckFunc">*GHookCheckFunc</a>)                   (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);

void                <a class="link" href="glib-Hook-Functions.html#g-hook-list-init">g_hook_list_init</a>                    (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> hook_size);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-list-invoke">g_hook_list_invoke</a>                  (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-list-invoke-check">g_hook_list_invoke_check</a>            (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-list-marshal">g_hook_list_marshal</a>                 (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookMarshaller">GHookMarshaller</a> marshaller,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);
void                (<a class="link" href="glib-Hook-Functions.html#GHookMarshaller">*GHookMarshaller</a>)                  (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-list-marshal-check">g_hook_list_marshal_check</a>           (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookCheckMarshaller">GHookCheckMarshaller</a> marshaller,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (<a class="link" href="glib-Hook-Functions.html#GHookCheckMarshaller">*GHookCheckMarshaller</a>)             (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-list-clear">g_hook_list_clear</a>                   (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list);

<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-alloc">g_hook_alloc</a>                        (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list);
#define             <a class="link" href="glib-Hook-Functions.html#g-hook-append">g_hook_append</a>                       ( hook_list, hook )
void                <a class="link" href="glib-Hook-Functions.html#g-hook-prepend">g_hook_prepend</a>                      (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-insert-before">g_hook_insert_before</a>                (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *sibling,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-insert-sorted">g_hook_insert_sorted</a>                (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookCompareFunc">GHookCompareFunc</a> func);
<a class="link" href="glib-Basic-Types.html#gint">gint</a>                (<a class="link" href="glib-Hook-Functions.html#GHookCompareFunc">*GHookCompareFunc</a>)                 (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *new_hook,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *sibling);
<a class="link" href="glib-Basic-Types.html#gint">gint</a>                <a class="link" href="glib-Hook-Functions.html#g-hook-compare-ids">g_hook_compare_ids</a>                  (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *new_hook,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *sibling);

<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-get">g_hook_get</a>                          (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gulong">gulong</a> hook_id);
<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-find">g_hook_find</a>                         (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookFindFunc">GHookFindFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (<a class="link" href="glib-Hook-Functions.html#GHookFindFunc">*GHookFindFunc</a>)                    (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-find-data">g_hook_find_data</a>                    (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-find-func">g_hook_find_func</a>                    (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> func);
<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-find-func-data">g_hook_find_func_data</a>               (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);

<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-first-valid">g_hook_first_valid</a>                  (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_be_in_call);
<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-next-valid">g_hook_next_valid</a>                   (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_be_in_call);
enum                <a class="link" href="glib-Hook-Functions.html#GHookFlagMask">GHookFlagMask</a>;
#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK-FLAGS:CAPS">G_HOOK_FLAGS</a>                        (hook)
#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK-FLAG-USER-SHIFT:CAPS">G_HOOK_FLAG_USER_SHIFT</a>

#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK:CAPS">G_HOOK</a>                              (hook)
#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK-IS-VALID:CAPS">G_HOOK_IS_VALID</a>                     (hook)
#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK-ACTIVE:CAPS">G_HOOK_ACTIVE</a>                       (hook)
#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK-IN-CALL:CAPS">G_HOOK_IN_CALL</a>                      (hook)
#define             <a class="link" href="glib-Hook-Functions.html#G-HOOK-IS-UNLINKED:CAPS">G_HOOK_IS_UNLINKED</a>                  (hook)

<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              <a class="link" href="glib-Hook-Functions.html#g-hook-ref">g_hook_ref</a>                          (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-unref">g_hook_unref</a>                        (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-free">g_hook_free</a>                         (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Hook-Functions.html#g-hook-destroy">g_hook_destroy</a>                      (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gulong">gulong</a> hook_id);
void                <a class="link" href="glib-Hook-Functions.html#g-hook-destroy-link">g_hook_destroy_link</a>                 (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3113248"></a><h2>Description</h2>
<p>
The <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>, <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> and their related functions provide support for
lists of hook functions. Functions can be added and removed from the lists,
and the list of hook functions can be invoked.

</p>
</div>
<div class="refsect1" lang="en">
<a name="id3113282"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3113292"></a><h3>
<a name="GHookList"></a>GHookList</h3>
<a class="indexterm" name="id3113304"></a><pre class="programlisting">typedef struct {
  gulong	    seq_id;
  guint		    hook_size : 16;
  guint		    is_setup : 1;
  GHook		   *hooks;
  gpointer	    dummy3;
  GHookFinalizeFunc finalize_hook;
  gpointer	    dummy[2];
} GHookList;
</pre>
<p>
The <span class="structname">GHookList</span> struct represents a 
list of hook functions.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gulong">gulong</a>&#160;<em class="structfield"><code>seq_id</code></em>;</span></p></td>
<td>the next free <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> id
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint">guint</a>&#160;<em class="structfield"><code>hook_size</code></em>&#160;:&#160;16;</span></p></td>
<td>the size of the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> elements, in bytes
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint">guint</a>&#160;<em class="structfield"><code>is_setup</code></em>&#160;:&#160;1;</span></p></td>
<td>1 if the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> has been initialized
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>&#160;*<em class="structfield"><code>hooks</code></em>;</span></p></td>
<td>the first <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> element in the list
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>&#160;<em class="structfield"><code>dummy3</code></em>;</span></p></td>
<td>unused
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Hook-Functions.html#GHookFinalizeFunc">GHookFinalizeFunc</a>&#160;<em class="structfield"><code>finalize_hook</code></em>;</span></p></td>
<td>the function to call to finalize a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> element. The
default behaviour is to call the hooks <code class="function">destroy</code> function
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>&#160;<em class="structfield"><code>dummy</code></em>[2];</span></p></td>
<td>unused

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3113523"></a><h3>
<a name="GHookFinalizeFunc"></a>GHookFinalizeFunc ()</h3>
<a class="indexterm" name="id3113536"></a><pre class="programlisting">void                (*GHookFinalizeFunc)                (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Defines the type of function to be called when a hook in a 
list of hooks gets finalized.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the hook in <em class="parameter"><code>hook_list</code></em> that gets finalized


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3113620"></a><h3>
<a name="GHook"></a>GHook</h3>
<a class="indexterm" name="id3113632"></a><pre class="programlisting">typedef struct {
  gpointer	 data;
  GHook		*next;
  GHook		*prev;
  guint		 ref_count;
  gulong	 hook_id;
  guint		 flags;
  gpointer	 func;
  GDestroyNotify destroy;
} GHook;
</pre>
<p>
The <span class="structname">GHook</span> struct represents a single hook 
function in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>&#160;<em class="structfield"><code>data</code></em>;</span></p></td>
<td>data which is passed to func when this hook is invoked
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>&#160;*<em class="structfield"><code>next</code></em>;</span></p></td>
<td>pointer to the next hook in the list
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>&#160;*<em class="structfield"><code>prev</code></em>;</span></p></td>
<td>pointer to the previous hook in the list
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint">guint</a>&#160;<em class="structfield"><code>ref_count</code></em>;</span></p></td>
<td>the reference count of this hook
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gulong">gulong</a>&#160;<em class="structfield"><code>hook_id</code></em>;</span></p></td>
<td>the id of this hook, which is unique within its list
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint">guint</a>&#160;<em class="structfield"><code>flags</code></em>;</span></p></td>
<td>flags which are set for this hook. See <a class="link" href="glib-Hook-Functions.html#GHookFlagMask"><span class="type">GHookFlagMask</span></a> for
    predefined flags
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>&#160;<em class="structfield"><code>func</code></em>;</span></p></td>
<td>the function to call when this hook is invoked. The possible 
signatures for this function are <a class="link" href="glib-Hook-Functions.html#GHookFunc"><span class="type">GHookFunc</span></a> and <a class="link" href="glib-Hook-Functions.html#GHookCheckFunc"><span class="type">GHookCheckFunc</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a>&#160;<em class="structfield"><code>destroy</code></em>;</span></p></td>
<td>the default <code class="function">finalize_hook</code> function of a 
<a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> calls this member of the hook that is being finalized

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3113874"></a><h3>
<a name="GHookFunc"></a>GHookFunc ()</h3>
<a class="indexterm" name="id3113886"></a><pre class="programlisting">void                (*GHookFunc)                        (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Defines the type of a hook function that can be invoked
by <a class="link" href="glib-Hook-Functions.html#g-hook-list-invoke"><code class="function">g_hook_list_invoke()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data field of the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is passed to the hook function here


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3113953"></a><h3>
<a name="GHookCheckFunc"></a>GHookCheckFunc ()</h3>
<a class="indexterm" name="id3113966"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (*GHookCheckFunc)                   (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Defines the type of a hook function that can be invoked
by <a class="link" href="glib-Hook-Functions.html#g-hook-list-invoke-check"><code class="function">g_hook_list_invoke_check()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data field of the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is passed to the hook function here
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> should be destroyed


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114060"></a><h3>
<a name="g-hook-list-init"></a>g_hook_list_init ()</h3>
<a class="indexterm" name="id3114073"></a><pre class="programlisting">void                g_hook_list_init                    (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> hook_size);</pre>
<p>
Initializes a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
This must be called before the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> is used.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_size</code></em>&#160;:</span></p></td>
<td>the size of each element in the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>, typically
    <code class="literal">sizeof (GHook)</code>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114180"></a><h3>
<a name="g-hook-list-invoke"></a>g_hook_list_invoke ()</h3>
<a class="indexterm" name="id3114193"></a><pre class="programlisting">void                g_hook_list_invoke                  (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse);</pre>
<p>
Calls all of the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> functions in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>may_recurse</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if functions which are already running (e.g. in another
    thread) can be called. If set to <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, these are skipped


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114306"></a><h3>
<a name="g-hook-list-invoke-check"></a>g_hook_list_invoke_check ()</h3>
<a class="indexterm" name="id3114318"></a><pre class="programlisting">void                g_hook_list_invoke_check            (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse);</pre>
<p>
Calls all of the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> functions in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
Any function which returns <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is removed from the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>may_recurse</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if functions which are already running (e.g. in another
thread) can be called. If set to <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, these are skipped


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114450"></a><h3>
<a name="g-hook-list-marshal"></a>g_hook_list_marshal ()</h3>
<a class="indexterm" name="id3114464"></a><pre class="programlisting">void                g_hook_list_marshal                 (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookMarshaller">GHookMarshaller</a> marshaller,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);</pre>
<p>
Calls a function on each valid <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>. 
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>may_recurse</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if hooks which are currently running (e.g. in another
    thread) are considered valid. If set to <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, these are skipped
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshaller</code></em>&#160;:</span></p></td>
<td>the function to call for each <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal_data</code></em>&#160;:</span></p></td>
<td>data to pass to <em class="parameter"><code>marshaller</code></em>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114626"></a><h3>
<a name="GHookMarshaller"></a>GHookMarshaller ()</h3>
<a class="indexterm" name="id3114639"></a><pre class="programlisting">void                (*GHookMarshaller)                  (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);</pre>
<p>
Defines the type of function used by <a class="link" href="glib-Hook-Functions.html#g-hook-list-marshal"><code class="function">g_hook_list_marshal()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal_data</code></em>&#160;:</span></p></td>
<td>user data


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114726"></a><h3>
<a name="g-hook-list-marshal-check"></a>g_hook_list_marshal_check ()</h3>
<a class="indexterm" name="id3114740"></a><pre class="programlisting">void                g_hook_list_marshal_check           (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_recurse,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookCheckMarshaller">GHookCheckMarshaller</a> marshaller,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);</pre>
<p>
Calls a function on each valid <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> and destroys it if the 
function returns <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>may_recurse</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if hooks which are currently running (e.g. in another
    thread) are considered valid. If set to <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, these are skipped
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshaller</code></em>&#160;:</span></p></td>
<td>the function to call for each <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal_data</code></em>&#160;:</span></p></td>
<td>data to pass to <em class="parameter"><code>marshaller</code></em>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3114914"></a><h3>
<a name="GHookCheckMarshaller"></a>GHookCheckMarshaller ()</h3>
<a class="indexterm" name="id3114927"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (*GHookCheckMarshaller)             (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> marshal_data);</pre>
<p>
Defines the type of function used by <a class="link" href="glib-Hook-Functions.html#g-hook-list-marshal-check"><code class="function">g_hook_list_marshal_check()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal_data</code></em>&#160;:</span></p></td>
<td>user data
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if <em class="parameter"><code>hook</code></em> should be destroyed


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115040"></a><h3>
<a name="g-hook-list-clear"></a>g_hook_list_clear ()</h3>
<a class="indexterm" name="id3115052"></a><pre class="programlisting">void                g_hook_list_clear                   (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list);</pre>
<p>
Removes all the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements from a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115122"></a><h3>
<a name="g-hook-alloc"></a>g_hook_alloc ()</h3>
<a class="indexterm" name="id3115135"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_alloc                        (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list);</pre>
<p>
Allocates space for a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> and initializes it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>a new <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115216"></a><h3>
<a name="g-hook-append"></a>g_hook_append()</h3>
<a class="indexterm" name="id3115229"></a><pre class="programlisting">#define             g_hook_append( hook_list, hook )</pre>
<p>
Appends a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> onto the end of a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to add to the end of <em class="parameter"><code>hook_list</code></em>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115314"></a><h3>
<a name="g-hook-prepend"></a>g_hook_prepend ()</h3>
<a class="indexterm" name="id3115327"></a><pre class="programlisting">void                g_hook_prepend                      (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Prepends a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> on the start of a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to add to the start of <em class="parameter"><code>hook_list</code></em>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115433"></a><h3>
<a name="g-hook-insert-before"></a>g_hook_insert_before ()</h3>
<a class="indexterm" name="id3115445"></a><pre class="programlisting">void                g_hook_insert_before                (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *sibling,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Inserts a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> into a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>, before a given <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to insert the new <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> before
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to insert


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115591"></a><h3>
<a name="g-hook-insert-sorted"></a>g_hook_insert_sorted ()</h3>
<a class="indexterm" name="id3115604"></a><pre class="programlisting">void                g_hook_insert_sorted                (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookCompareFunc">GHookCompareFunc</a> func);</pre>
<p>
Inserts a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> into a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>, sorted by the given function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to insert
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td>the comparison function used to sort the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115735"></a><h3>
<a name="GHookCompareFunc"></a>GHookCompareFunc ()</h3>
<a class="indexterm" name="id3115748"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a>                (*GHookCompareFunc)                 (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *new_hook,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *sibling);</pre>
<p>
Defines the type of function used to compare <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements in
<a class="link" href="glib-Hook-Functions.html#g-hook-insert-sorted"><code class="function">g_hook_insert_sorted()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>new_hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> being inserted
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to compare with <em class="parameter"><code>new_hook</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>a value &lt;= 0 if <em class="parameter"><code>new_hook</code></em> should be before <em class="parameter"><code>sibling</code></em>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3115880"></a><h3>
<a name="g-hook-compare-ids"></a>g_hook_compare_ids ()</h3>
<a class="indexterm" name="id3115893"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a>                g_hook_compare_ids                  (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *new_hook,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *sibling);</pre>
<p>
Compares the ids of two <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements, returning a negative value
if the second id is greater than the first.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>new_hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to compare with <em class="parameter"><code>new_hook</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>a value &lt;= 0 if the id of <em class="parameter"><code>sibling</code></em> is &gt;= the id of <em class="parameter"><code>new_hook</code></em>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3116015"></a><h3>
<a name="g-hook-get"></a>g_hook_get ()</h3>
<a class="indexterm" name="id3116027"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_get                          (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gulong">gulong</a> hook_id);</pre>
<p>
Returns the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> with the given id, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is not found.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_id</code></em>&#160;:</span></p></td>
<td>a hook id
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> with the given id, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is not found


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3116151"></a><h3>
<a name="g-hook-find"></a>g_hook_find ()</h3>
<a class="indexterm" name="id3116163"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_find                         (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Hook-Functions.html#GHookFindFunc">GHookFindFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Finds a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> using the given function to test for a match.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>need_valids</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements which have been destroyed should be
    skipped
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td>the function to call for each <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>, which should return <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when
    the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> has been found
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data to pass to <em class="parameter"><code>func</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the found <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no matching <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is found


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3116387"></a><h3>
<a name="GHookFindFunc"></a>GHookFindFunc ()</h3>
<a class="indexterm" name="id3116400"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (*GHookFindFunc)                    (<a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Defines the type of the function passed to <a class="link" href="glib-Hook-Functions.html#g-hook-find"><code class="function">g_hook_find()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>user data passed to <a class="link" href="glib-Hook-Functions.html#g-hook-find-func"><code class="function">g_hook_find_func()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the required <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> has been found


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3116524"></a><h3>
<a name="g-hook-find-data"></a>g_hook_find_data ()</h3>
<a class="indexterm" name="id3116537"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_find_data                    (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Finds a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> with the given data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>need_valids</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements which have been destroyed should be
    skipped
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data to find
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> with the given <em class="parameter"><code>data</code></em> or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no matching
    <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is found


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3116712"></a><h3>
<a name="g-hook-find-func"></a>g_hook_find_func ()</h3>
<a class="indexterm" name="id3116725"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_find_func                    (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> func);</pre>
<p>
Finds a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> with the given function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>need_valids</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements which have been destroyed should be
    skipped
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td>the function to find
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> with the given <em class="parameter"><code>func</code></em> or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no matching
    <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is found


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3116900"></a><h3>
<a name="g-hook-find-func-data"></a>g_hook_find_func_data ()</h3>
<a class="indexterm" name="id3116913"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_find_func_data               (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> need_valids,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Finds a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> with the given function and data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>need_valids</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> elements which have been destroyed should be
    skipped
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td>the function to find
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data to find
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> with the given <em class="parameter"><code>func</code></em> and <em class="parameter"><code>data</code></em> or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no matching
    <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is found


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117116"></a><h3>
<a name="g-hook-first-valid"></a>g_hook_first_valid ()</h3>
<a class="indexterm" name="id3117130"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_first_valid                  (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_be_in_call);</pre>
<p>
Returns the first <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> which has not been destroyed.
The reference count for the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is incremented, so you must call
<a class="link" href="glib-Hook-Functions.html#g-hook-unref"><code class="function">g_hook_unref()</code></a> to restore it when no longer needed. (Or call
<a class="link" href="glib-Hook-Functions.html#g-hook-next-valid"><code class="function">g_hook_next_valid()</code></a> if you are stepping through the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>may_be_in_call</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if hooks which are currently running (e.g. in another
    thread) are considered valid. If set to <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, these are skipped
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the first valid <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none are valid


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117311"></a><h3>
<a name="g-hook-next-valid"></a>g_hook_next_valid ()</h3>
<a class="indexterm" name="id3117324"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_next_valid                   (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook,
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> may_be_in_call);</pre>
<p>
Returns the next <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> which has not been destroyed.
The reference count for the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is incremented, so you must call
<a class="link" href="glib-Hook-Functions.html#g-hook-unref"><code class="function">g_hook_unref()</code></a> to restore it when no longer needed. (Or continue to call
<a class="link" href="glib-Hook-Functions.html#g-hook-next-valid"><code class="function">g_hook_next_valid()</code></a> until <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.)

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the current <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>may_be_in_call</code></em>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if hooks which are currently running (e.g. in another
    thread) are considered valid. If set to <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, these are skipped
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the next valid <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none are valid


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117537"></a><h3>
<a name="GHookFlagMask"></a>enum GHookFlagMask</h3>
<a class="indexterm" name="id3117550"></a><pre class="programlisting">typedef enum
{
  G_HOOK_FLAG_ACTIVE	    = 1 &lt;&lt; 0,
  G_HOOK_FLAG_IN_CALL	    = 1 &lt;&lt; 1,
  G_HOOK_FLAG_MASK	    = 0x0f
} GHookFlagMask;
</pre>
<p>
Flags used internally in the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> implementation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a name="G-HOOK-FLAG-ACTIVE:CAPS"></a><code class="literal">G_HOOK_FLAG_ACTIVE</code></span></p></td>
<td>set if the hook has not been destroyed
</td>
</tr>
<tr>
<td><p><span class="term"><a name="G-HOOK-FLAG-IN-CALL:CAPS"></a><code class="literal">G_HOOK_FLAG_IN_CALL</code></span></p></td>
<td>set if the hook is currently being run
</td>
</tr>
<tr>
<td><p><span class="term"><a name="G-HOOK-FLAG-MASK:CAPS"></a><code class="literal">G_HOOK_FLAG_MASK</code></span></p></td>
<td>A mask covering all bits reserved for
  hook flags; see <span class="type">G_HOOK_FLAGS_USER_SHIFT</span>

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117662"></a><h3>
<a name="G-HOOK-FLAGS:CAPS"></a>G_HOOK_FLAGS()</h3>
<a class="indexterm" name="id3117675"></a><pre class="programlisting">#define	G_HOOK_FLAGS(hook)		(G_HOOK (hook)-&gt;flags)
</pre>
<p>
Returns the flags of a hook.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117717"></a><h3>
<a name="G-HOOK-FLAG-USER-SHIFT:CAPS"></a>G_HOOK_FLAG_USER_SHIFT</h3>
<a class="indexterm" name="id3117730"></a><pre class="programlisting">#define G_HOOK_FLAG_USER_SHIFT	(4)
</pre>
<p>
The position of the first bit which is not reserved for internal
use be the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> implementation, i.e. 
<code class="literal">1 &lt;&lt; G_HOOK_FLAG_USER_SHIFT</code> is the first bit
which can be used for application-defined flags.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117763"></a><h3>
<a name="G-HOOK:CAPS"></a>G_HOOK()</h3>
<a class="indexterm" name="id3117775"></a><pre class="programlisting">#define	G_HOOK(hook)			((GHook*) (hook))
</pre>
<p>
Casts a pointer to a <code class="literal">GHook*</code>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a pointer


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117815"></a><h3>
<a name="G-HOOK-IS-VALID:CAPS"></a>G_HOOK_IS_VALID()</h3>
<a class="indexterm" name="id3117829"></a><pre class="programlisting">#define             G_HOOK_IS_VALID(hook)</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is valid, i.e. it is in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>, it is active
and it has not been destroyed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is valid


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3117924"></a><h3>
<a name="G-HOOK-ACTIVE:CAPS"></a>G_HOOK_ACTIVE()</h3>
<a class="indexterm" name="id3117937"></a><pre class="programlisting">#define             G_HOOK_ACTIVE(hook)</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is active, which is normally <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> until the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
is destroyed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is active


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118043"></a><h3>
<a name="G-HOOK-IN-CALL:CAPS"></a>G_HOOK_IN_CALL()</h3>
<a class="indexterm" name="id3118055"></a><pre class="programlisting">#define             G_HOOK_IN_CALL(hook)</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> function is currently executing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> function is currently executing


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118143"></a><h3>
<a name="G-HOOK-IS-UNLINKED:CAPS"></a>G_HOOK_IS_UNLINKED()</h3>
<a class="indexterm" name="id3118156"></a><pre class="programlisting">#define             G_HOOK_IS_UNLINKED(hook)</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is not in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>.

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is not in a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118259"></a><h3>
<a name="g-hook-ref"></a>g_hook_ref ()</h3>
<a class="indexterm" name="id3118271"></a><pre class="programlisting"><a class="link" href="glib-Hook-Functions.html#GHook">GHook</a>*              g_hook_ref                          (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Increments the reference count for a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to increment the reference count of
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the <em class="parameter"><code>hook</code></em> that was passed in (since 2.6)


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118380"></a><h3>
<a name="g-hook-unref"></a>g_hook_unref ()</h3>
<a class="indexterm" name="id3118393"></a><pre class="programlisting">void                g_hook_unref                        (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Decrements the reference count of a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>.
If the reference count falls to 0, the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> is removed from the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
and <a class="link" href="glib-Hook-Functions.html#g-hook-free"><code class="function">g_hook_free()</code></a> is called to free it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to unref


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118513"></a><h3>
<a name="g-hook-free"></a>g_hook_free ()</h3>
<a class="indexterm" name="id3118525"></a><pre class="programlisting">void                g_hook_free                         (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Calls the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> <em class="parameter"><code>finalize_hook</code></em> function if it exists, and frees the memory
allocated for the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to free


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118632"></a><h3>
<a name="g-hook-destroy"></a>g_hook_destroy ()</h3>
<a class="indexterm" name="id3118644"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_hook_destroy                      (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Basic-Types.html#gulong">gulong</a> hook_id);</pre>
<p>
Destroys a <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a>, given its ID.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_id</code></em>&#160;:</span></p></td>
<td>a hook ID
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> was found in the <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a> and destroyed


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3118764"></a><h3>
<a name="g-hook-destroy-link"></a>g_hook_destroy_link ()</h3>
<a class="indexterm" name="id3118778"></a><pre class="programlisting">void                g_hook_destroy_link                 (<a class="link" href="glib-Hook-Functions.html#GHookList">GHookList</a> *hook_list,
                                                         <a class="link" href="glib-Hook-Functions.html#GHook">GHook</a> *hook);</pre>
<p>
Removes one <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> from a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>, marking it inactive and calling
<a class="link" href="glib-Hook-Functions.html#g-hook-unref"><code class="function">g_hook_unref()</code></a> on it. 
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook_list</code></em>&#160;:</span></p></td>
<td>a <a class="link" href="glib-Hook-Functions.html#GHookList"><span class="type">GHookList</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hook</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Hook-Functions.html#GHook"><span class="type">GHook</span></a> to remove


</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3118889"></a><div class="refsect2" lang="en"><a name="id3118890"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id3118892"></a></div>
</div>
</div>
</body>
</html>
